package com.cz.shopping.excpetion;

import com.cz.shopping.model.vo.common.ResultCodeEnum;
import lombok.Data;

/**
 * @description <>
 * @author: zhouchaoyu
 * @Date: 2023-10-25
 */
@Data
public class CustomException extends RuntimeException{

    private Integer code;
    private String message;

    private ResultCodeEnum resultCodeEnum;

    public CustomException(ResultCodeEnum resultCodeEnum) {
        this.resultCodeEnum = resultCodeEnum ;
        this.code = resultCodeEnum.getCode() ;
        this.message = resultCodeEnum.getMessage();
    }

    public CustomException(Integer code , String message) {
        this.code = code ;
        this.message = message ;
    }
}
